home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 September / CHIP 1996 szeptember (CD07).zip / CHIP_CD07.ISO / povray30 / povmsdos.exe / POVMSDOS.ZIP / INCLUDE / SHAPES2.INC < prev    next >
Text File  |  1996-04-17  |  5KB  |  173 lines

  1. #ifdef(Shapes2_Inc_Temp)
  2. // do nothing
  3. #else
  4. #declare Shapes2_Inc_Temp = version
  5. #version 3.0
  6.  
  7. #ifdef(View_POV_Include_Stack)
  8. #   debug "including shapes2.inc\n"
  9. #end
  10.  
  11. /*
  12.               Persistence of Vision Raytracer Version 3.0
  13.          Implements additional, useful, but seldom used shapes
  14.  
  15.                     Contents:
  16.                     =========
  17.             Tetrahedron       HalfCone_Y
  18.             Octahedron        Pyramid
  19.             Dodecahedron      Pyramid2
  20.             Icosahedron       Square_X
  21.             Rhomboid          Square_Y
  22.             Hexagon           Square_Z
  23. */
  24.  
  25.  
  26. // Shapes by Tom Price [75300,620]:
  27. #declare Tetrahedron =
  28.  intersection 
  29.   {plane {-y,1}
  30.    plane {-z,1 rotate <19.47,    0, 0>}
  31.    plane {-z,1 rotate <19.47, -120, 0>}
  32.    plane {-z,1 rotate <19.47,  120, 0>}
  33.   }
  34.    
  35. #declare Octahedron = 
  36.  intersection 
  37.   {plane { z, 1 rotate < 35.26438968275, 0, 0>}
  38.    plane { z, 1 rotate <-35.26438968275, 0, 0>}
  39.    plane {-z, 1 rotate < 35.26438968275, 0, 0>}
  40.    plane {-z, 1 rotate <-35.26438968275, 0, 0>}
  41.    
  42.    plane { x, 1 rotate <0, 0, -35.26438968275>}
  43.    plane { x, 1 rotate <0, 0,  35.26438968275>}
  44.    plane {-x, 1 rotate <0, 0, -35.26438968275>}
  45.    plane {-x, 1 rotate <0, 0,  35.26438968275>}
  46.   }
  47.    
  48. #declare Dodecahedron = 
  49.  intersection 
  50.   {plane {-z, 1 rotate <-26.56505117708,    0, 0>}
  51.    plane {-z, 1 rotate <-26.56505117708,  -72, 0>}
  52.    plane {-z, 1 rotate <-26.56505117708, -144, 0>}
  53.    plane {-z, 1 rotate <-26.56505117708, -216, 0>}
  54.    plane {-z, 1 rotate <-26.56505117708, -288, 0>}
  55.    
  56.    plane {-z, 1 rotate <26.56505117708,  -36, 0>}
  57.    plane {-z, 1 rotate <26.56505117708, -108, 0>}
  58.    plane {-z, 1 rotate <26.56505117708, -180, 0>}
  59.    plane {-z, 1 rotate <26.56505117708, -252, 0>}
  60.    plane {-z, 1 rotate <26.56505117708, -324, 0>}
  61.    
  62.    plane { y, 1}
  63.    plane {-y, 1}
  64.   }
  65.    
  66. #declare Icosahedron = 
  67.  intersection 
  68.   {plane {-z, 1 rotate <52.6625,    0, 0>}
  69.    plane {-z, 1 rotate <52.6625,  -72, 0>}
  70.    plane {-z, 1 rotate <52.6625, -144, 0>}
  71.    plane {-z, 1 rotate <52.6625, -216, 0>}
  72.    plane {-z, 1 rotate <52.6625, -288, 0>}
  73.    
  74.    plane {-z, 1 rotate <10.8125,    0, 0>}
  75.    plane {-z, 1 rotate <10.8125,  -72, 0>}
  76.    plane {-z, 1 rotate <10.8125, -144, 0>}
  77.    plane {-z, 1 rotate <10.8125, -216, 0>}
  78.    plane {-z, 1 rotate <10.8125, -288, 0>}
  79.    
  80.    plane {-z, 1 rotate <-52.6625,  -36, 0>}
  81.    plane {-z, 1 rotate <-52.6625, -108, 0>}
  82.    plane {-z, 1 rotate <-52.6625, -180, 0>}
  83.    plane {-z, 1 rotate <-52.6625, -252, 0>}
  84.    plane {-z, 1 rotate <-52.6625, -324, 0>}
  85.    
  86.    plane {-z, 1 rotate <-10.8125,  -36, 0>}
  87.    plane {-z, 1 rotate <-10.8125, -108, 0>}
  88.    plane {-z, 1 rotate <-10.8125, -180, 0>}
  89.    plane {-z, 1 rotate <-10.8125, -252, 0>}
  90.    plane {-z, 1 rotate <-10.8125, -324, 0>}
  91.   }
  92.  
  93. // Shapes by others
  94. // Convenient  finite cone primitive, pointing up in the Y axis
  95. #declare HalfCone_Y = 
  96.  intersection 
  97.   {object {Cone_Y}
  98.    plane  { y, 0}
  99.    plane  {-y, 2}
  100.    translate <0, 1, 0>
  101.    scale <0.5, 1, 0.5>
  102.   }
  103.  
  104. /* Hexagonal Solid, axis along x */
  105. #declare  Hexagon = 
  106.  intersection
  107.   {plane {z, 1}  /* Rotate 90 in z axis to stand up */
  108.    plane {z, 1 rotate < 60, 0, 0>}
  109.    plane {z, 1 rotate <120, 0, 0>}
  110.    plane {z, 1 rotate <180, 0, 0>}
  111.    plane {z, 1 rotate <240, 0, 0>}
  112.    plane {z, 1 rotate <300, 0, 0>}
  113.    plane { x, 1}
  114.    plane {-x, 1}
  115.   }
  116.  
  117. /* Three Dimensional 4-Sided Diamond */
  118. #declare Rhomboid = 
  119.  intersection 
  120.   {plane {-x, 1 rotate <0, 0, -30>}
  121.    plane { x, 1 rotate <0, 0, -30>}
  122.    plane { z, 1}
  123.    plane {-z, 1}
  124.    plane { y, 1}
  125.    plane {-y, 1}
  126.   }
  127.  
  128. // Classic four-sided pyramids.
  129. // The first can't be used correctly in CSG, the second can.
  130. #declare Pyramid = 
  131.    union { // This isn't true CSG, it's just used for convenience
  132.       triangle { <-1, 0, -1>, <+1, 0, -1>, <0, 1, 0>  }
  133.       triangle { <+1, 0, -1>, <+1, 0, +1>, <0, 1, 0>  }
  134.       triangle { <-1, 0, +1>, <+1, 0, +1>, <0, 1, 0>  }
  135.       triangle { <-1, 0, +1>, <-1, 0, -1>, <0, 1, 0>  }
  136.  
  137.       triangle { <-1, 0, -1>, <-1, 0, +1>, <1, 0, +1>  }
  138.       triangle { <-1, 0, -1>, <+1, 0, -1>, <1, 0, +1>  }
  139.  
  140.    scale <1, 2, 1>
  141.    translate -y
  142. }
  143. #declare Pyramid2 = intersection {
  144.    plane { < 1, 0,  0>, 1  rotate <  0, 0,  40>}
  145.    plane { <-1, 0,  0>, 1  rotate <  0, 0, -40>}
  146.    plane { < 0, 0,  1>, 1  rotate <-40, 0,   0>}
  147.    plane { < 0, 0, -1>, 1  rotate < 40, 0,   0>}
  148.    plane { <0, -1, 0>, 0 }
  149.    translate <0 ,-1, 0>
  150. }            
  151.              
  152. // These next three are finite planes.
  153. #declare Square_X = /* Scale-able plane in x */
  154.   union 
  155.    {triangle {<0, 1, -1>, <0, -1, 1>, <0,  1,  1>}
  156.     triangle {<0, 1, -1>, <0, -1, 1>, <0, -1, -1>}
  157.    }
  158.  
  159. #declare Square_Y =  /* Scale-able plane in y */
  160.   union 
  161.    {triangle {<-1, 0, 1>, <1, 0, -1>, < 1, 0,  1>}
  162.     triangle {<-1, 0, 1>, <1, 0, -1>, <-1, 0, -1>}
  163.    }
  164.  
  165. #declare Square_Z =  /* Scale-able plane in z */
  166.   union 
  167.    {triangle {<-1, 1, 0>, <1, -1, 0>, <-1, -1, 0>}
  168.     triangle {<-1, 1, 0>, <1, -1, 0>, < 1,  1, 0>}
  169.    }
  170.  
  171. #version Shapes2_Inc_Temp
  172. #end
  173.